package com.zte.market.mapper;

import com.zte.market.pojo.Orderdetails;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 订单详情
 * @Auther: 许月
 * @Date: 2022/10/05/19:42
 */
@Mapper
public interface OrderdetailsMapper {
    /**
     * 通过订单 id 查询详情列表
     * @param orderId
     * @return
     */
    List<Orderdetails> queryByOrderId(@Param("orderId")String orderId);

    /**
     * 查询某个订单是否有订单详情
     * @param orderId
     * @return
     */
    Integer queryCountByOrderId(@Param("orderId") String orderId);

    /**
     * 批量添加
     * @param orderdetailsList
     * @return
     */
//    Integer addByOrderdetailsList(@Param("orderdetailsList") List<Orderdetails> orderdetailsList);

    /**
     * 添加订单详情
     * @param orderdetails
     * @return
     */
    Integer addByOrderdetails(@Param("Orderdetails") Orderdetails orderdetails);

    /**
     * 添加订单详情(自动配置detailsId )
     * @param orderdetails
     * @return
     */
    Integer addByOrderdetailsAutodetailsId(@Param("Orderdetails") Orderdetails orderdetails);

    /**
     * 根据订单id删除
     * @param orderId
     * @return
     */
    Integer deleteByOrderId(@Param("orderId")String orderId);

    /**
     * 根据订单详情编号 列表 批量删除删除订单详情信息
     * @param detailsIdList
     * @return
     */
    Integer deleteByDetailsIdList(@Param("detailsIdList") List<Integer> detailsIdList);

    /**
     * 修改订单详情
     * @param orderdetails
     * @return
     */
    Integer updateByOrderdetails(@Param("orderdetails") Orderdetails orderdetails);


}
